package com.ruandi.test05.bean;

public class Rectangle {
    private double chang;
    private double kuan;

    public Rectangle() {
    }

    public Rectangle(double chang, double kuan) {
        this.chang = chang;
        this.kuan = kuan;
    }



    public double getArea(){
        return chang*kuan;
    }
    public double getPerimeter(){
        System.out.println("周长:"+(chang+kuan)*2);
        return (chang+kuan)*2;
    }

    public void getInfo(){
        System.out.println("长："+chang+",宽："+kuan+",面积"+getArea()+",周长"+getPerimeter());
    }
    //get set


    public double getChang() {
        return chang;
    }

    public void setChang(double chang) {
        this.chang = chang;
    }

    public double getKuan() {
        return kuan;
    }

    public void setKuan(double kuan) {
        this.kuan = kuan;
    }
}
